{% extends "base.html" %}
{% import "bootstrap/wtf.html" as wtf %}
{% import "_macros.html" as macros %}
{% import "_my_wtf_macros.html" as my_wtf_macros %}
{% import "user/partial/search_user_form.html" as search_user_form_macro %}
{% import "user/partial/user_table.html" as user_table_macro %}

{% block title %}万屏时代OPC--用户消费记录{% endblock %}

{% block panel_heading %}
  万屏时代OPC--用户消费记录
{% endblock %}

{% block panel_body %}

    {% if pagination %}
    <div class="pagination">
        {{ macros.pagination_widget(pagination, 'op_bp.user_bid_costs', user_id=user.id) }}
    </div>
    {% endif %}
    <table id="cancel-attention-user-info-table" class="table table-bordered table-hover table-condensed table-striped">
        <thead>
            <tr>
                <th>工程商</th>
                <th>消耗类型</th>
                <th>本次变更点数</th>
                <th>剩余汇币</th>
                <th>项目ID</th>
                <th>时间</th>
            </tr>
        </thead>
        <tbody>
            {% for i in data %}
            <tr>
                <td>
                    {% if user %}
                        <a
                                href="{{ url_for('op_bp.user_info', user_id=user.id) }}"
                                name="user-info"
                                target="_blank">
                            {{ user.mobile | encrypt }}
                            <br>
                            {{ user.nickname }}
                        </a>
                    {% else %}
                        {{ user.mobile | encrypt }}
                        <br>
                        {{ user.nickname }}
                    {% endif %}
                </td>
                <td>{{ i.cost_type_display }} </td>
                <td>{{ i.bid_point }}</td>
                <td>{{ i.left_bid_point }}</td>
                <td>{{ i.demand_id }}</td>
                <td>{{ i.created_datetime }}</td>
            </tr>
            {% endfor %}
        </tbody>
    </table>

    {% if pagination %}
    <div class="pagination">
        {{ macros.pagination_widget(pagination, 'op_bp.user_bid_costs', user_id=user.id) }}
    </div>
    {% endif %}

{% endblock %}

